import request from '@/utils/request'

// 查看当前未通过理由为SD27001的信息
export function findAllRouterErrorInfo(semId) {
  return request({
    url: 'Unpass/findAllRouterErrorInfo',
    method: 'GET',
    params: {
      SemId: semId,
      unPassInfo: 'SD27001'
    }
  })
}

// 删除不通过信息
export function delUnPass(unpassId) {
  return request({
    url: 'Unpass/del',
    method: 'DELETE',
    params: {
      unpassId: unpassId
    }
  })
}
// 添加不通过信息
export function addUnPass(unpass) {
  return request({
    url: 'Unpass/add',
    method: 'POST',
    params: {
      unpassActId: unpass.actId,
      unpassInfo: unpass.unpassEndReason
    }
  })
}
// 根据unpassActId查不通过信息
export function getUnPassById(actId) {
  return request({
    url: 'Unpass/getAll',
    method: 'GET',
    params: {
      unpassActId: actId
    }
  })
}

// 修改不通过信息
export function updateUnPass(unpass) {
  return request({
    url: 'Unpass/update',
    method: 'PUT',
    params: {
      unpassActId: unpass.actId,
      unpassInfo: unpass.unpassEndReason,
      unpassId: unpass.unpassId
    }
  })
}

// 查找全部不通过信息
export function allUnPass() {
  return request({
    url: 'Unpass/getAll',
    method: 'get'
  })
}
